package com.ziyucoding.springboot.labs.lab7.shardingjdbc.dbtable.mapper;

import com.ziyucoding.springboot.labs.lab7.shardingjdbc.dbtable.dataobject.OrderDO;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 订单 Mapper
 *
 * @author ziyucoding
 * @date 2022-10-31
 **/
@Repository
public interface OrderMapper {

    /**
     * 保存订单
     *
     * @param order
     * @return void
     **/
    void insert(OrderDO order);

    /**
     * 根据ID查询订单信息
     *
     * @param id
     * @return OrderDO
     **/
    OrderDO selectById(@Param("id") Integer id);

    /**
     * 根据用户号查询订单列表
     *
     * @param userId
     * @return List<OrderDO>
     **/
    List<OrderDO> selectListByUserId(@Param("userId") Integer userId);
}
